<div class="container-fluid am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
            <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span> 卖出</div>
           
        </div>
    </div>
</div>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">卖出</div>
                </div>
                <div class="widget-body am-fr" style="overflow:initial;">
                    <div class="row am-cf" style="float: left;width: 40%;">
                        <form  action="" method="post" class="am-form tpl-form-line-form" id="sell-form" style="margin: auto;">
                            {:token()}
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label" style="padding: 0px;">可用USD</label>
                                <div class="am-u-sm-9">
                                    <b style=" color: red;">{$token.USD}</b>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label" style="padding: 0px;">可用FAE</label>
                                <div class="am-u-sm-9">
                                    <b style="color: red;">{$token.FAE}</b>
                                </div>
                            </div>
                             
                             <div class="am-form-group">
                                <label for="user-name" class="am-u-sm-3 am-form-label" style="padding: 0px;">1FAE=</label>
                                <div class="am-u-sm-9">
                                    <b>{$other[0]['exch_rate_usd']}USD</b>
                                </div>
                            </div>
                            <input type="hidden"  value="{$other[0]['exch_rate_usd']}" id="exch_rate_usd" class="tpl-form-input">
                            <input type="hidden"  value="{$main['exch_rate_usd']}" id="main" class="tpl-form-input">
                            
                           
                             <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">FAE</label>
                                <div class="am-input-group">
                                    <input type="hidden" name="symbol" value="{$main['symbol']}" id="symbol" class="tpl-form-input">
                                    <input type="hidden" name="tosymbol" value="{$tosymbol}" id="tosymbol" class="tpl-form-input">
                                    <input type="number" name="num" id="num" placeholder="请输入卖出数量" class="tpl-form-input">
                                    
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">获得USD</label>
                                <div class="am-input-group">
                                    <input type="number" disabled="disabled" placeholder="获得" id="shou" class="tpl-form-input">
                                   
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label">资金密码</label>
                                <div class="am-input-group">
                                   
                                    <input type="password" name="paypwd" id="paypwd" placeholder="请输入资金密码" class="tpl-form-input">
                                   
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3">
                                    <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success">卖出</button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <ul style="width: 60%; float: left;">
                            <h2 style="margin:20px 20px;">最新</h2>
                            <ol style="margin:0; width: 50%;float: left;">
                                <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                    <thead>
                                        <tr>
                                            <th>类型</th>
                                            <th>数量</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $i=1;?>
                                        {foreach $buy as  $vo}
                                        <tr class="gradeX">
                                            <td>买入{$i}</td>
                                            <td>{$vo.surplusnum}</td>
                                            <td>USD数量</td>
                                        </tr>
                                        <?php $i++;?>
                                        {/foreach}
                                    </tbody>
                                </table>
                            </ol>
                            <ol style="margin: 0;width: 50%;float: left;">
                                <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                    <thead>
                                        <tr>
                                            <th>类型</th>
                                            <th>数量</th>
                                            <th></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $i=1;?>
                                         {foreach $sell as  $va}
                                        <tr class="gradeX">
                                            <td>卖出{$i}</td>
                                            <td>{$va.surplusnum}</td>
                                            <td>USD数量</td>
                                        </tr>
                                        <?php $i++;?>
                                        {/foreach}
                                   
                                        <!-- more data -->
                                    </tbody>
                                </table>
                            </ol>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var input = document.getElementById('num');
    var div = document.getElementById('shou');
    var exch_rate_usd=document.getElementById('exch_rate_usd').value;
    var main=document.getElementById('main').value;
    input.oninput = function(){
        div.value = input.value*main*exch_rate_usd;
    }
</script>